<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head th:replace="~{commons/common::head('景点列表')}">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

        <!-- Bootstrap CSS -->
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css"/>
        <!-- 图标 -->
        <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.13.0/css/all.css">
        <link rel="stylesheet" th:href="@{/css/common.css}" href="../static/css/common.css">
        <title>详情</title>
    </head>
    <body>
        <!-- 顶部 -->
        <div th:replace="~{commons/common::navbar(2)}" class="header bg-white mb-3 shadow-sm"></div>

        <div class="main">
            <!-- 内容 -->
            <div class="container">
                <div class="mt-3">
                    <h3 class="my-3"><i class=""></i><span>旅游景点</span></h3>
                    <div class="list-group">
                        <a href="#" th:each="site, siteStat : ${sitePage.records}"
                           th:href="@{/site/detail/{site_id}(site_id=${site.siteId})}"
                           class="list-group-item list-group-item-action p-4">
                            <div class="row">
                                <div>
                                    <img th:src="@{${site.siteImg}}" src="../static/img/im_bg.jpg" width="200px">
                                </div>
                                <div class="col ml-5">
                                    <h5 th:text="${site.siteName}">华山</h5>
                                    <span th:text="${#strings.abbreviate(site.siteInfo, 150)}" class="text-muted">
                                            华山，古称“西岳”，雅称“太华山”，为五岳之一，位于陕西省渭南市华阴市，在省会西安以东120千米处。南接秦岭，北瞰黄渭，自古以来就有“奇险天下第一山”的说法。 中华之“华”源于华山，由此，华山有了“华夏之根”之称 。华山是道教主流全真派圣地，为“第四洞天”，也是中国民间广泛崇奉的神祇，即西岳华山君
                                        </span>
                                    <button class=" btn btn-link text-decoration-none float-right mt-2 mr-2">
                                        <i class="fas fa-chevron-right"></i> 详情
                                    </button>
                                </div>
                            </div>
                        </a>
                    </div>
                </div>
                <nav aria-label="Page navigation example" class="mt-3 float-right"
                     th:object="${sitePage}" th:if="${sitePage.pages > 1}">
                    <ul class="pagination">
                        <li class="page-item" th:classappend="*{!hasPrevious()} ? 'disabled' : ''">
                            <a class="page-link" th:href="@{/site/list(page=1)}" aria-label="Previous">首页</a>
                        </li>
                        <li class="page-item" th:classappend="*{hasPrevious()} ? '' : 'disabled'">
                            <a class="page-link" th:if="*{(current - 1) > 0}" th:href="@{/site/list(page=*{current}-1)}"
                               aria-label="Previous">上一页</a>
                            <a class="page-link" th:if="*{(current - 1) <= 0}" th:href="@{/site/list(page=1)}"
                               aria-label="Previous">上一页</a>
                        </li>
                        <li class="page-item" th:each="page : *{#numbers.sequence(1, pages)}"
                            th:classappend="(${page}==*{current})?'active':''">
                            <a class="page-link" th:href="@{/site/list(page=${page})}" th:text="${page}">1</a>
                        </li>
                        <li class="page-item" th:classappend="*{hasNext()} ? '' : 'disabled'">
                            <a class="page-link" th:if="*{(current + 1) < pages}"
                               th:href="@{/site/list(page=*{current}+1)}"
                               aria-label="Previous">下一页</a>
                            <a class="page-link" th:if="*{(current + 1) >= pages}"
                               th:href="@{/site/list(page=*{pages})}"
                               aria-label="Previous">下一页</a>
                        </li>
                        <li class="page-item" th:classappend="*{!hasNext()} ? 'disabled' : ''">
                            <a class="page-link" th:href="@{/site/list(page=*{pages})}" aria-label="Previous">末页</a>
                        </li>
                    </ul>
                    <div class="text-primary text-center">
                        <span>第 <span th:text="*{current}">1</span> 页</span>
                        /
                        <span>共 <span th:text="*{pages}">10</span> 页</span>
                    </div>
                </nav>
            </div>
        </div>

        <!-- 底部 -->
        <!--<footer th:replace="~{commons/common::footer}" class="navbar-fixed-bottom mt-5 text-muted small"></footer>-->
        <!--<footer th:fragment="footer" class="navbar-fixed-bottom mt-lg-5 text-muted small"
                style="position:fixed; bottom: 0; width: 100%">
            <div class="bg-dark text-center">
                <div class="p-1">欢迎来西安旅游</div>
                <div class="p-1">邮箱: 1241088536@qq.com</div>
                <div class="p-1">备案号: 陕xxxxx</div>
            </div>
        </footer>-->

        <th:block th:replace="~{commons/common::commonJs}"/>
        <script src='https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js'></script>
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js"></script>
        <script th:src="@{/js/bootstrapQ.js}" src='../static/js/bootstrapQ.js'></script>
        <script th:inline="javascript">

        </script>
    </body>
</html>